package com.lx.ngsl.exam.quest.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.lx.ngsl.exam.quest.entity.QuestEntity;

public interface QuestRepository extends JpaRepository<QuestEntity, String> {

	
	Page<QuestEntity> findAll(Specification<QuestEntity> spec, Pageable pageable);
	
	List<QuestEntity> findByQuest(String quest);
	List<QuestEntity> findByType(String type);
	/*
	 * 查询用户错题
	 */
	@Query(" from QuestEntity q where q.id in :ids")
	List<QuestEntity> findByIds(@Param("ids") List<String> ids);
}
